package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"log"
	myServices "mygrpc/services"
)
func main() {
	conn,err := grpc.Dial("127.0.0.1:8081", grpc.WithInsecure())
	if err != nil {
		log.Fatal(err)
	}
	defer conn.Close()
	productClient := myServices.NewProductServiceClient(conn)
	productRes,err := productClient.GetProductStock(context.Background(),
		&myServices.ProductRequest{ProductId: 12})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(productRes.ProductStock)


}
